if
statement is used for conditional execution:
if_stmt: "if" condition ":" suite ("elif" condition ":" suite)* ["else" ":" suite]It selects exactly one of the suites by evaluating the conditions one by one until one is found to be true (see section
if
statement is executed or evaluated). If
all conditions are false, the suite of the else
clause, if
present, is executed.
elif
else